package com.richinfo.proxy.dynamic.jdk;

import java.lang.reflect.Proxy;

import com.richinfo.proxy.demo.Client;
import com.richinfo.proxy.demo.Subject;
import com.richinfo.proxy.demo.impl.RealSubject;

/**
 * Created by WangXJ
 * 2019-07-04 11:26
 */
public class JdkClient {

	public static void main(String[] args) {
		Subject subject = (Subject) Proxy.newProxyInstance(Client.class.getClassLoader(), 
				new Class[] {Subject.class}, new JdkProxySubject(new RealSubject()));
		subject.request();
		subject.hello();
	}

}
